﻿<!--#include file="../base.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="../skin/default/main.css" rel="stylesheet" type="text/css" />
<link href="../skin/default/ready.css" rel="stylesheet" type="text/css" />
</head>

<body style="background:url(../skin/default/images/default_bg.JPG)">

<div id="container">
	<div id="ready_title">普通话准备</div>
    <div id="menu">
		<ul id="nav">
		<%
		dim sql,rs,rsChild,i
		i=1
		sql="select * from category where parCat=29 and menuable=1 and [delete]=0 order by catOrder"
		set rs=GetRecordset(sql,0)
		
		if not rs.eof and not rs.bof then
		do while not rs.eof
		%>
		<li><a href="javascript:void(0)"  onclick="DoMenu('ChildMenu<%=i%>')"><%=rs("catName")%></a>
			<ul id="ChildMenu<%=i%>" class="collapsed">
			<%
			sql="select * from category where parCat="&rs("catID")&" and menuable=1 and [delete]=0 order by catOrder"
			set rsChild=GetRecordset(sql,0)
		
		    if not rsChild.eof and not rsChild.bof then
		    do while not rsChild.eof
			%>
			<li><a href="rright.asp?catid=<%=rsChild("catID")%>" target="rright"><%=rsChild("catName")%></a></li>
			<%
			rsChild.movenext
			loop
			end if
			%>
			</ul>
		</li>
		<%
		i=i+1
		rs.movenext
		loop
		end if
		
		rsChild.close
		set rsChild=nothing
		rs.close
		set rs=nothing
		%>		
		</ul>
    </div>
</div>
</body>
</html>
<script type=text/javascript><!--
var LastLeftID = "";
function menuFix() {
	var obj = document.getElementById("nav").getElementsByTagName("li");
	
	for (var i=0; i<obj.length; i++) {
		obj[i].onmouseover=function() {
			this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		obj[i].onMouseDown=function() {
			this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		obj[i].onMouseUp=function() {
			this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		obj[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
		}
	}
}
function DoMenu(emid)
{
	var obj = document.getElementById(emid);	
	obj.className = (obj.className.toLowerCase() == "expanded"?"collapsed":"expanded");
	if((LastLeftID!="")&&(emid!=LastLeftID))	//关闭上一个Menu
	{
		document.getElementById(LastLeftID).className = "collapsed";
	}
	LastLeftID = emid;
}
function GetMenuID()
{
	var MenuID="";
	var _paramStr = new String(window.location.href);
	var _sharpPos = _paramStr.indexOf("#");
	
	if (_sharpPos >= 0 && _sharpPos < _paramStr.length - 1)
	{
		_paramStr = _paramStr.substring(_sharpPos + 1, _paramStr.length);
	}
	else
	{
		_paramStr = "";
	}
	
	if (_paramStr.length > 0)
	{
		var _paramArr = _paramStr.split("&");
		if (_paramArr.length>0)
		{
			var _paramKeyVal = _paramArr[0].split("=");
			if (_paramKeyVal.length>0)
			{
				MenuID = _paramKeyVal[1];
			}
		}
		/*
		if (_paramArr.length>0)
		{
			var _arr = new Array(_paramArr.length);
		}
		
		//取所有#后面的，菜单只需用到Menu
		//for (var i = 0; i < _paramArr.length; i++)
		{
			var _paramKeyVal = _paramArr[i].split('=');
			
			if (_paramKeyVal.length>0)
			{
				_arr[_paramKeyVal[0]] = _paramKeyVal[1];
			}		
		}
		*/
	}
	
	if(MenuID!="")
	{
		DoMenu(MenuID)
	}
}
GetMenuID();	//*这两个function的顺序要注意一下，不然在Firefox里GetMenuID()不起效果
menuFix();
--></script>